//
//  MFMWPhotoBrowser.m
//  QinjinProject
//
//  Created by Michael Fan on 14/11/16.
//  Copyright (c) 2014年 ___Michael___. All rights reserved.
//

#import "MFMWPhotoBrowser.h"
#import "MWPhotoBrowserPrivate.h"

@implementation MFMWPhotoBrowser

-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    if (NSVersionNumber_iOS_7_0) {
        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    }
}

-(void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}

- (void)viewDidLoad {
    
    if (self.displayDeleteButton)
    {
        _actionButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(actionButtonPressedDelete:)];
        self.displayActionButton = NO;
    }
    
    [super viewDidLoad];
}

-(void)actionButtonPressedDelete:(id)sender
{
    if (_actionsSheet)
    {
        // Dismiss
        [_actionsSheet dismissWithClickedButtonIndex:_actionsSheet.cancelButtonIndex animated:YES];
        
    } else {
        if ([self.mfDelegate respondsToSelector:@selector(photoBrowerNeedDeletePhoto:AtIndex:)]) {
            [self.mfDelegate photoBrowerNeedDeletePhoto:self AtIndex:_currentPageIndex];
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
